package hibernateDemo.DAO;

import java.io.Serializable;
import java.util.List;

import hibernateDemo.entity.Teacher;
import hibernateDemo.util.HibernateUtil;

public class TeacherDAO {
	public void save(Teacher teacher) {
		HibernateUtil.save(teacher);
	}
	public void delete(Teacher teacher) {
		HibernateUtil.delete(teacher);
	}
	public void update(Teacher teacher) {
		HibernateUtil.update(teacher);
	}
	public Teacher get(String name) {
		return (Teacher)HibernateUtil.get(name,"Teacher");
	}
	public Teacher get(long id) {
		return (Teacher)HibernateUtil.get(Teacher.class,id);
	}
	public List getAll() {
		return (List<Teacher>)HibernateUtil.getAll("Teacher");
	}
}